
<!DOCTYPE HTML>
<html lang="en" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>5.3 布尔逻辑 · 命令进阶</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.2">
        
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
        <link rel="stylesheet" href="../styles/website.css">
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="loop.html" />
    
    
    <link rel="prev" href="score.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    引言
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../concepts/concepts.html">
            
                <a href="../concepts/concepts.html">
            
                    
                    1 基础概念
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../concepts/space.html">
            
                <a href="../concepts/space.html">
            
                    
                    1.1 坐标、朝向、区块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../concepts/time.html">
            
                <a href="../concepts/time.html">
            
                    
                    1.2 时间、顺序
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="../concepts/execution.html">
            
                <a href="../concepts/execution.html">
            
                    
                    1.3 命令执行
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="../concepts/selector/selector.html">
            
                <a href="../concepts/selector/selector.html">
            
                    
                    1.4 目标选择器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.5" data-path="../concepts/stats.html">
            
                <a href="../concepts/stats.html">
            
                    
                    1.5 命令执行统计
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../common-format/common-format.html">
            
                <a href="../common-format/common-format.html">
            
                    
                    2 常用命令格式
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../common-format/json/json.html">
            
                <a href="../common-format/json/json.html">
            
                    
                    2.1 JSON文本
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1.1" data-path="../common-format/json/type.html">
            
                <a href="../common-format/json/type.html">
            
                    
                    2.1.1 JSON文本类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.2" data-path="../common-format/json/formatting.html">
            
                <a href="../common-format/json/formatting.html">
            
                    
                    2.1.2 JSON样式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.3" data-path="../common-format/json/event.html">
            
                <a href="../common-format/json/event.html">
            
                    
                    2.1.3 JSON事件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.4" data-path="../common-format/json/array.html">
            
                <a href="../common-format/json/array.html">
            
                    
                    2.1.4 JSON分项
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.5" data-path="../common-format/json/sign-book.html">
            
                <a href="../common-format/json/sign-book.html">
            
                    
                    2.1.5 告示牌及成书
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.6" data-path="../common-format/json/other.html">
            
                <a href="../common-format/json/other.html">
            
                    
                    2.1.6 杂项
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.7" data-path="../common-format/json/keys.html">
            
                <a href="../common-format/json/keys.html">
            
                    
                    2.1.A 附录: keybind列表
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../common-format/nbt/nbt.html">
            
                <a href="../common-format/nbt/nbt.html">
            
                    
                    2.2 NBT及结构
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.2.1" data-path="../common-format/nbt/simple.html">
            
                <a href="../common-format/nbt/simple.html">
            
                    
                    2.2.1 基本类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2.2" data-path="../common-format/nbt/example.html">
            
                <a href="../common-format/nbt/example.html">
            
                    
                    2.2.2 NBT实战
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../command/command.html">
            
                <a href="../command/command.html">
            
                    
                    3 如何执行命令
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../command/chat.html">
            
                <a href="../command/chat.html">
            
                    
                    3.1 聊天栏
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../command/cb.html">
            
                <a href="../command/cb.html">
            
                    
                    3.2 命令方块简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="../command/function.html">
            
                <a href="../command/function.html">
            
                    
                    3.3 命令函数
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../scoreboard/scoreboard.html">
            
                <a href="../scoreboard/scoreboard.html">
            
                    
                    4 记分板
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../scoreboard/objective.html">
            
                <a href="../scoreboard/objective.html">
            
                    
                    4.1 记分板变量
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../scoreboard/team.html">
            
                <a href="../scoreboard/team.html">
            
                    
                    4.2 记分板队伍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="../scoreboard/tag.html">
            
                <a href="../scoreboard/tag.html">
            
                    
                    4.3 记分板标签
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4" data-path="../scoreboard/command.html">
            
                <a href="../scoreboard/command.html">
            
                    
                    4.4 记分板命令
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.5" data-path="../scoreboard/example.html">
            
                <a href="../scoreboard/example.html">
            
                    
                    4.5 记分板实战
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.5.1" data-path="../scoreboard/examples/example1.html">
            
                <a href="../scoreboard/examples/example1.html">
            
                    
                    4.5.1 循环电路|记分板的基础操作
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.5.2" data-path="../scoreboard/examples/example2.html">
            
                <a href="../scoreboard/examples/example2.html">
            
                    
                    4.5.2 自定义命令|stats与记分板
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.5.3" data-path="../scoreboard/examples/example3.html">
            
                <a href="../scoreboard/examples/example3.html">
            
                    
                    4.5.3 击杀率|operation与准则
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.5.4" data-path="../scoreboard/examples/example4.html">
            
                <a href="../scoreboard/examples/example4.html">
            
                    
                    4.5.4 漂亮的排名|显示与队伍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.5.5" data-path="../scoreboard/examples/example5.html">
            
                <a href="../scoreboard/examples/example5.html">
            
                    
                    4.5.5 简单登入系统|function与综合运用
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="logic.html">
            
                <a href="logic.html">
            
                    
                    5 基础逻辑
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="enum.html">
            
                <a href="enum.html">
            
                    
                    5.1 穷举
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="score.html">
            
                <a href="score.html">
            
                    
                    5.2 分数处理
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.6.3" data-path="bool.html">
            
                <a href="bool.html">
            
                    
                    5.3 布尔逻辑
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="loop.html">
            
                <a href="loop.html">
            
                    
                    5.4 循环
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.5" data-path="event.html">
            
                <a href="event.html">
            
                    
                    5.5 事件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6" data-path="marker.html">
            
                <a href="marker.html">
            
                    
                    5.6 实体Marker
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.7" data-path="execute.html">
            
                <a href="execute.html">
            
                    
                     5.7 execute进阶
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../practise/practise.html">
            
                <a href="../practise/practise.html">
            
                    
                    6 实战
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../practise/objects.html">
            
                <a href="../practise/objects.html">
            
                    
                    6.1 游戏内物件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../practise/test-debug.html">
            
                <a href="../practise/test-debug.html">
            
                    
                    6.2 命令系统测试及调试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="../practise/examples/examples.html">
            
                <a href="../practise/examples/examples.html">
            
                    
                    6.3 更多命令系统例子
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.3.1" data-path="../practise/examples/furnace.html">
            
                <a href="../practise/examples/furnace.html">
            
                    
                    6.3.1 熔炉过热系统
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3.2" data-path="../practise/examples/badapple.html">
            
                <a href="../practise/examples/badapple.html">
            
                    
                    6.3.2 毒苹果
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3.3" data-path="../practise/examples/rain.html">
            
                <a href="../practise/examples/rain.html">
            
                    
                    6.3.3 下雨检测
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3.4" data-path="../practise/examples/chest_replace.html">
            
                <a href="../practise/examples/chest_replace.html">
            
                    
                    6.3.4 替换方块实体
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3.5" data-path="../practise/examples/skill.html">
            
                <a href="../practise/examples/skill.html">
            
                    
                    6.3.5 技能系统
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3.6" data-path="../practise/examples/crown.html">
            
                <a href="../practise/examples/crown.html">
            
                    
                    6.3.6 皇冠系统
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3.7" data-path="../practise/examples/blackhole.html">
            
                <a href="../practise/examples/blackhole.html">
            
                    
                    6.3.7 黑洞
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3.8" data-path="../practise/examples/login.html">
            
                <a href="../practise/examples/login.html">
            
                    
                    6.3.8 登录系统
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../data-files/data-files.html">
            
                <a href="../data-files/data-files.html">
            
                    
                    7 游戏文件的使用
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="../data-files/resourcepack/resourcepack.html">
            
                <a href="../data-files/resourcepack/resourcepack.html">
            
                    
                    7.1 资源包
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1.1" data-path="../data-files/resourcepack/textures.html">
            
                <a href="../data-files/resourcepack/textures.html">
            
                    
                    7.1.1 材质
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.1.2" data-path="../data-files/resourcepack/models.html">
            
                <a href="../data-files/resourcepack/models.html">
            
                    
                    7.1.2 模型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.1.3" data-path="../data-files/resourcepack/sound.html">
            
                <a href="../data-files/resourcepack/sound.html">
            
                    
                    7.1.3 声音
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8.2" data-path="../data-files/loot-table.html">
            
                <a href="../data-files/loot-table.html">
            
                    
                    7.2 Loot table
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3" data-path="../data-files/advancements/advancements.html">
            
                <a href="../data-files/advancements/advancements.html">
            
                    
                    7.3 Advancement
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.3.1" data-path="../data-files/advancements/examples.html">
            
                <a href="../data-files/advancements/examples.html">
            
                    
                    Advancement例子
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9" >
            
                <span>
            
                    
                    8 杂项
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.1" >
            
                <a target="_blank" href="https://commandtutorials.neocities.org/">
            
                    
                    8.1 其他资源
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.2" data-path="../misc/success.html">
            
                <a href="../misc/success.html">
            
                    
                    8.2 如何成为一个成功的CBer
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.3" data-path="../misc/question.html">
            
                <a href="../misc/question.html">
            
                    
                    8.3 问问题的技巧
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4" data-path="../misc/quotes.html">
            
                <a href="../misc/quotes.html">
            
                    
                    8.4 其他CBer的建言
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >5.3 布尔逻辑</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="&#x903B;&#x8F91;&#x8FD0;&#x7B97;---and-or-not">&#x903B;&#x8F91;&#x8FD0;&#x7B97;---And, or, not</h1>
<p>&#x4EC0;&#x4E48;&#x662F;&#x903B;&#x8F91;&#x8FD0;&#x7B97;&#x5462;&#xFF1F;&#x5C31;&#x662F;&#x5BF9;&#x5E03;&#x5C14;&#x503C;&#xFF08;boolean&#xFF0C;&#x6709;&#x4E24;&#x4E2A;&#x503C;true/false&#xFF09;&#x8FDB;&#x884C;&#x8FD0;&#x7B97;<br>&#x5E38;&#x7528;&#x7684;&#x5C31;&#x662F;&#x8981;&#x591A;&#x4E2A;&#x6761;&#x4EF6;&#x540C;&#x65F6;&#x7B26;&#x5408;(and)&#xFF0C;&#x6216;&#x8005;&#x662F;&#x4EFB;&#x4F55;&#x4E00;&#x4E2A;&#x6761;&#x4EF6;&#x7B26;&#x5408;(or)&#xFF0C;&#x6216;&#x662F;&#x4E0D;&#x80FD;&#x7B26;&#x5408;&#x67D0;&#x4E2A;&#x6761;&#x4EF6;(not)</p>
<h2 id="&#x771F;&#x503C;&#x8868;">&#x771F;&#x503C;&#x8868;</h2>
<p>&#x4EE5;&#x4E0B;&#x8868;&#x683C;&#x53EF;&#x4EE5;&#x62D3;&#x5C55;&#x81F3;n&#x4E2A;&#x4E0D;&#x540C;&#x8F93;&#x5165;/&#x8F93;&#x51FA;</p>
<table>
<thead>
<tr>
<th>&#x8F93;&#x5165;</th>
<th>and</th>
<th>or</th>
</tr>
</thead>
<tbody>
<tr>
<td>True, True</td>
<td>True</td>
<td>True</td>
</tr>
<tr>
<td>True, False</td>
<td>False</td>
<td>True</td>
</tr>
<tr>
<td>False, True</td>
<td>False</td>
<td>True</td>
</tr>
<tr>
<td>False, False</td>
<td>False</td>
<td>False</td>
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
<th>&#x8F93;&#x5165;</th>
<th>not</th>
</tr>
</thead>
<tbody>
<tr>
<td>True</td>
<td>False</td>
</tr>
<tr>
<td>False</td>
<td>True</td>
</tr>
</tbody>
</table>
<h2 id="mc&#x5B9E;&#x73B0;and">MC&#x5B9E;&#x73B0;And</h2>
<h3 id="&#x8BB0;&#x5206;&#x677F;&#x9009;&#x62E9;&#x5668;">&#x8BB0;&#x5206;&#x677F;+&#x9009;&#x62E9;&#x5668;</h3>
<p>&#x9009;&#x62E9;&#x5668;&#x7684;&#x89C4;&#x5219;&#x5C31;&#x662F;&#x9009;&#x62E9;&#x5230;&#x7684;&#x5B9E;&#x4F53;&#x5FC5;&#x987B;&#x662F;<strong>&#x7B26;&#x5408;&#x6240;&#x6709;&#x6761;&#x4EF6;</strong>&#x7684;<br>&#x7531;&#x4E8E;&#x8BB0;&#x5206;&#x677F;&#x7684;&#x9009;&#x62E9;&#x5668;&#x53C2;&#x6570;&#x662F;<code>score_XXX</code>&#x6216;&#x8005;&#x662F;<code>score_XXX_min</code>&#xFF0C;&#x56E0;&#x6B64;&#x53EF;&#x4EE5;&#x540C;&#x65F6;&#x6709;&#x591A;&#x4E2A;&#x53C2;&#x6570;<br>&#x56E0;&#x6B64;&#xFF0C;&#x4F60;&#x53EF;&#x4EE5;&#x7528;&#x591A;&#x4E2A;&#x53C2;&#x6570;&#x6765;&#x6307;&#x5B9A;&#x540C;&#x65F6;&#x62E5;&#x6709;&#x591A;&#x4E2A;&#x5206;&#x6570;&#x7684;&#x5B9E;&#x4F53;<br>&#x4E3E;&#x4E2A;&#x4F8B;&#x5B50;&#xFF0C;<code>@e[score_a=5,score_a_min=5,score_b=6,score_b_min=6]</code>&#xFF0C;&#x5C31;&#x662F;&#x9009;&#x62E9;&#x6240;&#x6709;&#x8BB0;&#x5206;&#x677F;a=5&#x3001;b=6&#x7684;&#x5B9E;&#x4F53;</p>
<blockquote>
<p>&#x9700;&#x8981;&#x6CE8;&#x610F;&#x7684;&#x662F;&#xFF0C;&#x9664;&#x4E86;&#x8BB0;&#x5206;&#x677F;&#x4EE5;&#x5916;&#x7684;&#x53C2;&#x6570;&#x90FD;&#x4E0D;&#x80FD;&#x91CD;&#x590D;&#x51FA;&#x73B0;&#xFF08;<code>score_a</code>&#x548C;<code>score_b</code>&#x5B9E;&#x4E3A;&#x4E0D;&#x540C;&#x53C2;&#x6570;&#xFF0C;&#x56E0;&#x6B64;&#x53EF;&#x201C;&#x91CD;&#x590D;&#x201D;&#xFF09;&#xFF0C;&#x8BE6;&#x89C1;<a href="../concepts/selector/selector.html">&#x9009;&#x62E9;&#x5668;&#x6559;&#x7A0B;</a></p>
</blockquote>
<h3 id="execute&#x547D;&#x4EE4;">execute&#x547D;&#x4EE4;</h3>
<p>&#x5982;&#x679C;&#x662F;&#x540C;&#x65F6;&#x9700;&#x8981;&#x591A;&#x4E2A;tag&#xFF0C;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;execute+@s&#x6765;&#x9009;&#x62E9;&#x3002;<br>&#x5982;&#x6211;&#x4EEC;&#x9700;&#x8981;&#x540C;&#x65F6;&#x6709;a, b, c tag&#xFF0C;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#xFF1A;</p>
<pre><code>execute @e[tag=a] ~ ~ ~ execute @s[tag=b] ~ ~ ~ execute @s[tag=c] ~ ~ ~ &#x547D;&#x4EE4;
</code></pre><blockquote>
<p>&#x4E5F;&#x53EF;&#x4EE5;&#x505A;&#x5230;&#x591A;&#x53CD;&#x9009;</p>
</blockquote>
<h3 id="stats">Stats</h3>
<p>&#x901A;&#x8FC7;&#x68C0;&#x6D4B;SuccessCount&#xFF0C;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x5F97;&#x77E5;&#x4E4B;&#x524D;&#x7684;&#x547D;&#x4EE4;&#x6709;&#x6CA1;&#x6709;&#x6210;&#x529F;&#xFF0C;&#x7136;&#x540E;&#x6267;&#x884C;&#x522B;&#x7684;&#x547D;&#x4EE4;&#x3002;&#x8FD9;&#x6837;&#x5728;&#x547D;&#x4EE4;&#x51FD;&#x6570;&#x91CC;&#x4E5F;&#x80FD;&#x505A;&#x5230;&#x6761;&#x4EF6;&#x5236;&#x7EA6;&#x3002;<br>&#x5982;&#x679C;&#x547D;&#x4EE4;a&#x4E4B;&#x540E;&#x7684;&#x547D;&#x4EE4;&#x9700;&#x8981;SuccessCount&#x5927;&#x4E8E;&#x7B49;&#x4E8E;1&#x624D;&#x80FD;&#x7EE7;&#x7EED;&#x6267;&#x884C;&#xFF08;&#x901A;&#x8FC7;<code>execute</code>&#x547D;&#x4EE4;&#xFF09;&#xFF0C;&#x90A3;&#x5C31;&#x4EE3;&#x8868;&#x4E86;&#x5982;&#x679C;&#x524D;&#x9762;&#x4EFB;&#x4F55;&#x4E00;&#x4E2A;&#x547D;&#x4EE4;&#x51FA;&#x73B0;&#x9519;&#x8BEF;&#xFF0C;&#x540E;&#x9762;&#x7684;&#x547D;&#x4EE4;&#x5C31;&#x6CA1;&#x6CD5;&#x6267;&#x884C;&#xFF0C;&#x8FD9;&#x4E5F;&#x662F;and&#x7684;&#x4E00;&#x79CD;&#x3002;</p>
<p>&#x4F8B;&#x5B50;&#xFF08;&#x547D;&#x4EE4;&#x51FD;&#x6570;&#xFF0C;&#x5047;&#x8BBE;&#x7531;&#x5B9E;&#x4F53;&#x6267;&#x884C;&#x5E76;&#x4E14;&#x6709;&#x4E00;&#x4E2A;&#x53D8;&#x91CF;&#x53EB;scb&#xFF09;&#xFF1A;</p>
<pre><code>scoreboard players set @s scb 0
stats entity @s set SuccessCount @s scb

# &#x68C0;&#x6D4B;&#x547D;&#x4EE4;
testfor @s[score_test=3]
# &#x5982;&#x679C;&#x4E0D;&#x6210;&#x529F;&#x7684;&#x8BDD;&#x4E0B;&#x9762;&#x8FD9;&#x6761;&#x547D;&#x4EE4;&#x4E5F;&#x4E0D;&#x4F1A;&#x6267;&#x884C;
execute @s[score_scb_min=1] ~ ~ ~ testfor @s[score_test_min=3]

# &#x5982;&#x679C;&#x4E0A;&#x9762;&#x4EFB;&#x610F;&#x4E00;&#x6761;&#x547D;&#x4EE4;&#x5931;&#x8D25;&#x4E86;&#x7684;&#x8BDD;&#x8FD9;&#x6761;&#x547D;&#x4EE4;&#x4E5F;&#x4E0D;&#x4F1A;&#x6267;&#x884C;
# &#x5982;&#x679C;&#x662F;&#x7B2C;&#x4E00;&#x6761;&#x68C0;&#x6D4B;&#x5931;&#x8D25;&#x4E86;&#xFF0C;&#x90A3;&#x4E48;scb&#x8FD8;&#x662F;0&#xFF0C;&#x6267;&#x884C;&#x4E0D;&#x4E86;
# &#x5982;&#x679C;&#x662F;&#x7B2C;&#x4E8C;&#x6761;&#x68C0;&#x6D4B;&#x5931;&#x8D25;&#x4E86;&#xFF0C;&#x90A3;&#x4E48;scb&#x5C31;&#x4F1A;&#x53D8;&#x4E3A;0&#xFF0C;&#x6267;&#x884C;&#x4E0D;&#x4E86;
execute @s[score_scb_min=1] ~ ~ ~ say test = 3
</code></pre><h2 id="mc&#x5B9E;&#x73B0;or">MC&#x5B9E;&#x73B0;Or</h2>
<h3 id="&#x591A;&#x6761;&#x547D;&#x4EE4;">&#x591A;&#x6761;&#x547D;&#x4EE4;</h3>
<p>&#x8FD9;...&#x7B80;&#x5355;&#x5230;&#x6211;&#x90FD;&#x4E0D;&#x77E5;&#x9053;&#x6709;&#x5565;&#x53EF;&#x4EE5;&#x8BF4;&#x660E;&#x7684;&#x4E86;&#x3002;<br>&#x4E0D;&#x8FC7;&#x6CE8;&#x610F;&#xFF0C;&#x8981;&#x5C0F;&#x5FC3;&#x91CD;&#x590D;&#x6267;&#x884C;&#x547D;&#x4EE4;&#xFF0C;&#x591A;&#x6761;&#x547D;&#x4EE4;&#x7684;&#x6761;&#x4EF6;&#x5C3D;&#x91CF;&#x4E0D;&#x8981;&#x91CD;&#x590D;&#x3002;</p>
<h3 id="&#x8BB0;&#x5206;&#x677F;tag">&#x8BB0;&#x5206;&#x677F;tag</h3>
<p>&#x65B9;&#x6CD5;&#x5F88;&#x7B80;&#x5355;&#xFF0C;&#x5206;&#x522B;&#x68C0;&#x6D4B;&#x4E0D;&#x540C;&#x60C5;&#x51B5;&#x662F;&#x5426;&#x7B26;&#x5408;&#xFF0C;&#x7B26;&#x5408;&#x5C31;&#x7ED9;&#x5B9E;&#x4F53;&#x4E00;&#x4E2A;&#x5206;&#x6570;/&#x6807;&#x7B7E;&#x3002;&#x7136;&#x540E;&#x9488;&#x5BF9;&#x90A3;&#x4E2A;&#x5206;&#x6570;/&#x6807;&#x7B7E;&#x7684;&#x5B9E;&#x4F53;&#x6267;&#x884C;&#x547D;&#x4EE4;</p>
<p>&#x4F8B;&#x5B50;:</p>
<pre><code>scoreboard players set @a[tag=a] tagScb 1
scoreboard players set @a[tag=b] tagScb 1
execute @a[score_tagScb_min=1,score_tagScb=1] ~ ~ ~ say &#x6211;&#x6709;a/b&#x6807;&#x7B7E;
</code></pre><p>&#x8FD9;&#x65B9;&#x6CD5;&#x770B;&#x8D77;&#x6765;&#x9700;&#x8981;&#x7684;&#x547D;&#x4EE4;&#x591A;&#x4E00;&#x70B9;&#xFF0C;&#x7136;&#x800C;&#x6709;&#x4E24;&#x4E2A;&#x597D;&#x5904;&#xFF1A;</p>
<ul>
<li>&#x4E0D;&#x4F1A;&#x91CD;&#x590D;&#x6267;&#x884C;&#x547D;&#x4EE4;&#x3002;&#x5C31;&#x7B97;&#x6761;&#x4EF6;&#x91CD;&#x590D;&#x4E86;&#xFF0C;&#x88AB;&#x9009;&#x62E9;&#x5230;&#x7684;&#x5B9E;&#x4F53;&#x8FD8;&#x662F;&#x90A3;&#x4E2A;</li>
<li>&#x91CD;&#x590D;&#x4F7F;&#x7528;&#x8BE5;&#x6761;&#x4EF6;&#x65F6;&#x8FD9;&#x65B9;&#x5F0F;&#x80FD;&#x8282;&#x7701;&#x547D;&#x4EE4;&#x6570;&#x91CF;&#x3002;</li>
</ul>
<h2 id="mc&#x5B9E;&#x73B0;not">MC&#x5B9E;&#x73B0;Not</h2>
<p>not&#x5C31;&#x662F;&#x5F53;&#x6761;&#x4EF6;&#x4E0D;&#x6EE1;&#x8DB3;&#x7684;&#x65F6;&#x5019;&#x624D;&#x6267;&#x884C;&#x547D;&#x4EE4;(&#x4E3A;&#x4E86;&#x65B9;&#x4FBF;&#xFF0C;&#x4E0B;&#x9762;&#x4F1A;&#x7528;!&#x4EE3;&#x8868;not)<br>&#x4E3E;&#x4E2A;&#x4F8B;&#x5B50;&#xFF0C;&#x5206;&#x6570;a!=5&#x7684;&#x65F6;&#x5019;say hi&#xFF0C;&#x5C31;&#x662F;&#x5206;&#x6570;&#x4E0D;&#x7B49;&#x4E8E;5&#x7684;&#x65F6;&#x5019;&#x624D;say hi</p>
<h3 id="&#x8BB0;&#x5206;&#x677F;&#x5206;&#x6570;">&#x8BB0;&#x5206;&#x677F;&#x5206;&#x6570;</h3>
<p>&#x9996;&#x5148;&#x7ED9;&#x6240;&#x6709;&#x5B9E;&#x4F53;&#x4E00;&#x4E2A;&#x521D;&#x59CB;&#x5206;&#x6570;&#xFF0C;&#x7136;&#x540E;&#x7ED9;&#x7B26;&#x5408;&#x6761;&#x4EF6;&#x7684;&#x5B9E;&#x4F53;&#x53E6;&#x4E00;&#x4E2A;&#x5206;&#x6570;<br>&#x8FD8;&#x7EF4;&#x6301;&#x7740;&#x539F;&#x6765;&#x5206;&#x6570;&#x7684;&#x5B9E;&#x4F53;&#x5C31;&#x81EA;&#x7136;&#x662F;&#x4E0D;&#x7B26;&#x5408;&#x90A3;&#x4E9B;&#x6761;&#x4EF6;&#x7684;&#x5B9E;&#x4F53;&#x4E86;</p>
<pre><code>scoreboard players set @e notSlime 1
scoreboard players set @e[type=Slime] notSlime 0
scoreboard players set @e[type=LavaSlime] notSlime 0
execute @e[score_notSlime_min=1] ~ ~ ~ say i am not slime
</code></pre><blockquote>
<p>&#x6CE8;&#x610F;: &#x8BB0;&#x5206;&#x677F;&#x7684;&#x597D;&#x5904;&#x5728;&#x4E8E;&#x80FD;&#x591F;&#x5728;&#x5927;&#x91CF;&#x903B;&#x8F91;&#x7684;&#x65F6;&#x5019;&#x8FDB;&#x884C;&#x7B80;&#x5316;, &#x800C;&#x4E14;&#x5982;&#x679C;&#x4E0D;&#x6B62;&#x662F;not&#x4E00;&#x79CD;&#x7684;&#x8BDD;, &#x8BB0;&#x5206;&#x677F;&#x5C31;&#x80FD;&#x505A;&#x5230;&#x7279;&#x6B8A;&#x4F18;&#x5316;</p>
</blockquote>
<h3 id="tag">tag</h3>
<p>&#x539F;&#x7406;&#x5C31;&#x662F;&#x8FD9;&#x6837;&#xFF0C;&#x7ED9;&#x7B26;&#x5408;&#x8981;&#x6C42;&#x7684;&#x5B9E;&#x4F53;&#x4E00;&#x4E2A;tag&#xFF0C;&#x7136;&#x540E;&#x7528;=!tag&#x9009;&#x62E9;&#x6CA1;&#x90A3;&#x4E2A;tag&#x7684;&#x5B9E;&#x4F53;</p>
<pre><code>scoreboard players tag @e[type=Slime] add Slime
scoreboard players tag @e[type=LavaSlime] add Slime
execute @e[tag=!Slime] ~ ~ ~ say i am not slime
</code></pre><blockquote>
<p>&#x6CE8;&#x610F;: tag&#x7684;&#x8BDD;&#x5219;&#x4E0D;&#x80FD;&#x505A;&#x5230;and&#x3002;&#x5982;&#x679C;&#x9700;&#x8981;&#x590D;&#x6742;&#x903B;&#x8F91;&#x7684;&#x8BDD;&#x5EFA;&#x8BAE;&#x4F7F;&#x7528;&#x8BB0;&#x5206;&#x677F;&#x5206;&#x6570;&#xFF0C;&#x56E0;&#x4E3A;&#x90A3;&#x6BD4;&#x8F83;&#x65B9;&#x4FBF;&#x4F18;&#x5316;</p>
</blockquote>
<h3 id="stats">Stats</h3>
<p>&#x548C;And&#x7684;&#x90E8;&#x5206;&#x7C7B;&#x4F3C;&#xFF0C;&#x6211;&#x4EEC;&#x68C0;&#x6D4B;SuccessCount=0&#x5C31;&#x597D;&#xFF0C;&#x6240;&#x4EE5;&#x8FD9;&#x91CC;&#x5C31;&#x4E0D;&#x591A;&#x52A0;&#x4EE5;&#x63CF;&#x8FF0;&#x4E86;&#x3002;</p>
<p>&#x7136;&#x800C;&#x6CE8;&#x610F;&#x591A;&#x4E2A;&#x6761;&#x4EF6;&#xFF0C;&#x6BD4;&#x5982;</p>
<pre><code># &#x7ED1;&#x5B9A;stats&#x7684;&#x5C31;&#x4E0D;&#x5199;&#x4E86;

testfor @s[score_test=0]
execute @s[score_stats=0] ~ ~ ~ testfor @s[score_test_min=10]
execute @s[score_stats=0] ~ ~ ~ say 1-9
</code></pre><p>&#x8FD9;&#x662F;&#x9519;&#x7684;&#x3002;<br>&#x56E0;&#x4E3A;&#x5982;&#x679C;&#x6EE1;&#x8DB3;&#x4E86;&#x7B2C;&#x4E00;&#x6761;&#x547D;&#x4EE4;&#xFF0C;&#x7B2C;&#x4E8C;&#x6761;&#x547D;&#x4EE4;&#x81EA;&#x7136;&#x5C31;&#x4F1A;&#x5931;&#x8D25;&#xFF0C;&#x800C;stats&#x5C31;&#x4F1A;&#x53D8;&#x4E3A;0&#xFF0C;&#x6EE1;&#x8DB3;&#x4E86;&#x7B2C;&#x4E09;&#x6761;&#x547D;&#x4EE4;&#x3002;<br>&#x4E0A;&#x9762;&#x7684;&#x547D;&#x4EE4;&#x5176;&#x5B9E;&#x662F; <strong>not ((not a) and b)</strong>&#xFF0C;&#x4E5F;&#x5C31;&#x662F;<code>a or (not b)</code>&#x3002;</p>
<h3 id="&#x547D;&#x4EE4;&#x51FD;&#x6570;">&#x547D;&#x4EE4;&#x51FD;&#x6570;</h3>
<p>&#x547D;&#x4EE4;&#x51FD;&#x6570;&#x80FD;&#x591F;&#x5F88;&#x65B9;&#x4FBF;&#x7684;&#x505A;&#x5230;if &#x548C; unless(else)&#x3002;<br>&#x6545;&#x6B64;&#x590D;&#x6742;&#x7684;&#x6761;&#x4EF6;&#x53EF;&#x4EE5;&#x62C6;&#x6210;if else&#x90E8;&#x5206;&#x653E;&#x8FDB;&#x4E0D;&#x540C;&#x547D;&#x4EE4;&#x51FD;&#x6570;&#x8FDB;&#x884C;&#x8C03;&#x7528;&#x3002;</p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="score.html" class="navigation navigation-prev " aria-label="Previous page: 5.2 分数处理">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="loop.html" class="navigation navigation-next " aria-label="Next page: 5.4 循环">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"5.3 布尔逻辑","level":"1.6.3","depth":2,"next":{"title":"5.4 循环","level":"1.6.4","depth":2,"path":"logic/loop.md","ref":"logic/loop.md","articles":[]},"previous":{"title":"5.2 分数处理","level":"1.6.2","depth":2,"path":"logic/score.md","ref":"logic/score.md","articles":[]},"dir":"ltr"},"config":{"plugins":["expandable-chapters","lb2br","-sharing"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"expandable-chapters":{},"lb2br":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"命令进阶","language":"en","gitbook":"*","description":"一份Minecraft命令教程"},"file":{"path":"logic/bool.md","mtime":"2017-07-29T07:52:21.879Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2017-11-08T10:37:55.949Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

